window.$config = {
    // host: location.hostname=='120.76.28.144'?'//www.cheerhub.com.hk':'',
    // host: location.hostname=='m.cheerhub.com.cn'?'//www.cheerhub.com.hk':'',
    // host: location.hostname=='test.cheerhub.com.hk'?'//qa.cheerhub.com.hk':'',
    host: location.hostname=='m.cheerhub.com.hk'?'//www.cheerhub.com.hk':'',
    // host: location.hostname=='//www.cheerhub.com.cn',
    // host:'/server',
    rex:{
        tel : /^1[34578]\d{9}$/,
        gattel : /^[1][3-8]\d{9}$|^([6|9])\d{7}$|^[0][9]\d{8}$|^[6]([8|6])\d{5}$/
    },
    //获取页面顶部被卷起来的高度
    scrollTop : function(){
        return Math.max(
            //chrome
            document.body.scrollTop,
            //firefox/IE
            document.documentElement.scrollTop);
    },
    //获取页面文档的总高度
     documentHeight :function(){
        //现代浏览器（IE9+和其他浏览器）和IE8的document.body.scrollHeight和document.documentElement.scrollHeight都可以
        return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    },
    //获取页面浏览器视口的高度
     windowHeight : function(){
        //document.compatMode有两个取值。BackCompat：标准兼容模式关闭。CSS1Compat：标准兼容模式开启。
        return (document.compatMode == "CSS1Compat")?
            document.documentElement.clientHeight:
            document.body.clientHeight;
    },
    //是否滚动到底部100
    isScrollBottom : function (num) {
        return this.scrollTop()+this.windowHeight()+(num?num:0)>=this.documentHeight();
    },
    iswx : function(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            return true;
        }else{
            return false;
        }
    },
    wxShare : function() {
        var config = oe_wxconfig,
            title = "微信分享标题",
            summary = "描述",
            link = location.href,
            thumb = "http://h5.oeeee.com/h5/zmhhr/logo.jpg",
            content = {
                title: title,
                desc:summary,
                link: link,
                imgUrl:thumb,
                type: '',
                dataUrl: '',
                success: function () {},
                cancel: function () {}
            }

        wx.config({
            debug: false,
            appId: config.appId,
            timestamp: config.timestamp,
            nonceStr: config.nonceStr,
            signature: config.signature,
            jsApiList: [
                'onMenuShareAppMessage','onMenuShareTimeline','onMenuShareQQ','onMenuShareWeibo'
            ]
        });
        wx.checkJsApi({
            jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline','onMenuShareQQ','onMenuShareWeibo'],
            success: function(res) {}
        });
        wx.ready(function () {
            wx.onMenuShareAppMessage(content);
            wx.onMenuShareTimeline(content);
            wx.onMenuShareQQ(content);
            wx.onMenuShareWeibo(content);
        });
    }
}